//Define your namespaces
var TribunalHelper = {
	scorers: {}
};

TribunalHelper.ReportableOffenses = [
	"Offensive Language",
	"Verbal Abuse",
	"Intentional Feeding",
	"Assisting Enemy Team",
	"Refusing to Communicate",
	"AFK",
	"Negative Attitude",
	"Spamming"
]
	
TribunalHelper.ProfanityList = [
	"ahole",
	"anus",
	"ashle",
	"ashles",
	"asholes",
	"ass",
	"Ass Monkey",
	"Assface",
	"asshle",
	"asshlez",
	"asshole",
	"assholes",
	"assholz",
	"asswipe",
	"azzhole",
	"bassterds",
	"bastard",
	"bastards",
	"bastardz",
	"basterds",
	"basterdz",
	"Biatch",
	"bitch",
	"bitches",
	"Blow Job",
	"boffing",
	"butthole",
	"buttwipe",
	"cck",
	"ccks",
	"ck",
	"Carpet Muncher",
	"cawk",
	"cawks",
	"Clit",
	"cnts",
	"cntz",
	"cock",
	"cockhead",
	"cock-head",
	"cocks",
	"CockSucker",
	"cock-sucker",
	"crap",
	"cum",
	"cunt",
	"cunts",
	"cuntz",
	"dick",
	"dild",
	"dilds",
	"dildo",
	"dildos",
	"dilld",
	"dillds",
	"dominatricks",
	"dominatrics",
	"dominatrix",
	"dyke",
	"enema",
	"f u c k",
	"f u c k e r",
	"fag",
	"fagt",
	"faget",
	"faggt",
	"faggit",
	"faggot",
	"fagit",
	"fags",
	"fagz",
	"faig",
	"faigs",
	"fart",
	"flipping the bird",
	"fuck",
	"fucker",
	"fuckin",
	"fucking",
	"fucks",
	"Fudge Packer",
	"fuk",
	"Fukah",
	"Fuken",
	"fuker",
	"Fukin",
	"Fukk",
	"Fukkah",
	"Fukken",
	"Fukker",
	"Fukkin",
	"gk",
	"gay",
	"gayboy",
	"gaygirl",
	"gays",
	"gayz",
	"God-damned",
	"hr",
	"har",
	"hre",
	"hells",
	"hoar",
	"hoor",
	"hoore",
	"jackoff",
	"jap",
	"japs",
	"jerk-off",
	"jisim",
	"jiss",
	"jizm",
	"jizz",
	"knob",
	"knobs",
	"knobz",
	"kunt",
	"kunts",
	"kuntz",
	"Lesbian",
	"Lezzian",
	"Lipshits",
	"Lipshitz",
	"masochist",
	"masokist",
	"massterbait",
	"masstrbait",
	"masstrbate",
	"masterbaiter",
	"masterbate",
	"masterbates",
	"Motha Fucker",
	"Motha Fuker",
	"Motha Fukkah",
	"Motha Fukker",
	"Mother Fucker",
	"Mother Fukah",
	"Mother Fuker",
	"Mother Fukkah",
	"Mother Fukker",
	"mother-fucker",
	"Mutha Fucker",
	"Mutha Fukah",
	"Mutha Fuker",
	"Mutha Fukkah",
	"Mutha Fukker",
	"ngr",
	"nastt",
	"nigger;",
	"nigur;",
	"niiger;",
	"niigr;",
	"orafis",
	"orgasim;",
	"orgasm",
	"orgasum",
	"oriface",
	"orifice",
	"orifiss",
	"packi",
	"packie",
	"packy",
	"paki",
	"pakie",
	"paky",
	"pecker",
	"peeenus",
	"peeenusss",
	"peenus",
	"peinus",
	"pens",
	"penas",
	"penis",
	"penis-breath",
	"penus",
	"penuus",
	"Phuc",
	"Phuck",
	"Phuk",
	"Phuker",
	"Phukker",
	"polac",
	"polack",
	"polak",
	"Poonani",
	"prc",
	"prck",
	"prk",
	"pusse",
	"pussee",
	"pussy",
	"puuke",
	"puuker",
	"queer",
	"queers",
	"queerz",
	"qweers",
	"qweerz",
	"qweir",
	"recktum",
	"rectum",
	"retard",
	"sadist",
	"scank",
	"schlong",
	"screwing",
	"semen",
	"sex",
	"sexy",
	"Sh!t",
	"sht",
	"shter",
	"shts",
	"shtter",
	"shtz",
	"shit",
	"shits",
	"shitter",
	"Shitty",
	"Shity",
	"shitz",
	"Shyt",
	"Shyte",
	"Shytty",
	"Shyty",
	"skanck",
	"skank",
	"skankee",
	"skankey",
	"skanks",
	"Skanky",
	"slut",
	"sluts",
	"Slutty",
	"slutz",
	"son-of-a-bitch",
	"tit",
	"turd",
	"vajina",
	"vagna",
	"vagiina",
	"vagina",
	"vajna",
	"vajina",
	"vullva",
	"vulva",
	"wp",
	"whr",
	"whre",
	"whore",
	"xrated",
	"xxx",
	"b!+ch",
	"bitch",
	"blowjob",
	"clit",
	"arschloch",
	"fuck",
	"shit",
	"ass",
	"asshole",
	"b!tch",
	"bch",
	"btch",
	"bastard",
	"bi+ch",
	"boiolas",
	"buceta",
	"cck",
	"cawk",
	"chink",
	"cipa",
	"clits",
	"cock",
	"cum",
	"cunt",
	"dildo",
	"dirsa",
	"ejakulate",
	"fatass",
	"fcuk",
	"fuk",
	"fuxr",
	"hoer",
	"hore",
	"jism",
	"kawk",
	"litch",
	"li+ch",
	"lesbian",
	"masturbate",
	"masterbat*",
	"masterbat",
	"motherfucker",
	"s.o.b.",
	"mofo",
	"nazi",
	"nigga",
	"nigger",
	"nutsack",
	"phuck",
	"pimpis",
	"pusse",
	"pussy",
	"scrotum",
	"sh!t",
	"shemale",
	"shi+",
	"sh!+",
	"slut",
	"smut",
	"teets",
	"tits",
	"boobs",
	"bbs",
	"teez",
	"testical",
	"testicle",
	"titt",
	"wse",
	"jackoff",
	"wank",
	"whoar",
	"whore",
	"*damn",
	"*dyke",
	"*fuck*",
	"*shit*",
	"@$$",
	"amcik",
	"andskota",
	"arse*",
	"assrammer",
	"ayir",
	"bich",
	"bitch*",
	"bollock*",
	"breasts",
	"butt-pirate",
	"cabron",
	"cazzo",
	"chraa",
	"chuj",
	"Cock*",
	"cunt*",
	"dmn",
	"daygo",
	"dego",
	"dick*",
	"dike*",
	"dupa",
	"dziwka",
	"ejackulate",
	"Ekrem*",
	"Ekto",
	"enculer",
	"faen",
	"fag*",
	"fanculo",
	"fanny",
	"feces",
	"feg",
	"Felcher",
	"ficken",
	"fitt*",
	"Flikker",
	"foreskin",
	"Fotze",
	"Fu(*",
	"fuk*",
	"futkretzn",
	"gay",
	"gook",
	"guiena",
	"hr",
	"hxr",
	"hell",
	"helvete",
	"hoer*",
	"honkey",
	"Huevon",
	"hui",
	"injun",
	"jizz",
	"kanker*",
	"kike",
	"klootzak",
	"kraut",
	"knulle",
	"kuk",
	"kuksuger",
	"Kurac",
	"kurwa",
	"kusi*",
	"kyrpa*",
	"lesbo",
	"mamhoon",
	"masturbat*",
	"merd*",
	"mibun",
	"monkleigh",
	"mouliewop",
	"muie",
	"mulkku",
	"muschi",
	"nazis",
	"nepesaurio",
	"nigger*",
	"orospu",
	"paska*",
	"perse",
	"picka",
	"pierdol*",
	"pillu*",
	"pimmel",
	"piss*",
	"pizda",
	"poontsee",
	"poop",
	"porn",
	"prn",
	"prn",
	"preteen",
	"pula",
	"pule",
	"puta",
	"puto",
	"qahbeh",
	"queef*",
	"rautenberg",
	"schaffer",
	"scheiss*",
	"schlampe",
	"schmuck",
	"screw",
	"sh!t*",
	"sharmuta",
	"sharmute",
	"shipal",
	"shiz",
	"skribz",
	"skurwysyn",
	"sphencter",
	"spic",
	"spierdalaj",
	"splooge",
	"suka",
	"bb*",
	"testicle*",
	"titt*",
	"twat",
	"vittu",
	"wank*",
	"wetback*",
	"wichser",
	"wop*",
	"yed",
	"zabourah",
	"f u",
	"noob",
	"nood",
	"noobs",
	"feed",
	"feeder",
	"nerds"
]

TribunalHelper.Game = function (gameEl) {
	//...
};

TribunalHelper.Game.prototype = {
	//...
	
	score: function () {
		var reports = this.getReports(),
			score = 0,
			scorer, i, length;
		
		for (i = 0, length = reports.length; i < length; i = i + 1) {
			scorer = new TribunalHelper.scorer[reports[i].type](this);
			
			score = score + scorer.score();
		}
		
		return score / reports.length;
	}
};

TribunalHelper.Game.getReports = function (){
	var numReports = document.getElementsByClassName("report-reason");
	for (i = 0, length = reports.length; i < length; i = i + 1) {
		var reports[i] = document.getElementsByClassName("report-reason")[i].innerHTML;
	}
	return reports;
};

TribunalHelper.Game.findNumberOfGames = function () {
	var games = 0;
	games = document.getElementsByClassName("total-games-fill")[0].innerHTML;
	return games;
};
	
TribunalHelper.Game.findNumberOfReports = function () {
	var reports = 0;
	reports = document.getElementsByClassName("total-reports-fill")[0].innerHTML;
	return reports;
};

TribunalHelper.Game.findOutcome = function () {
	return document.getElementById("stat-outcome-fill").innerHTML;
};

TribunalHelper.Game.findGameLength = function () {
	return document.getElementById("stat-length-fill").innerHTML;
};

TribunalHelper.Game.findGameType = function () {
	return document.getElementById("stat-type-fill").innerHTML;
};

TribunalHelper.scorers.Spamming = function (game) {
	//...
};

TribunalHelper.scorers.Spamming.prototype = {
	//...
	
	score: function () {
		//...
	}
};

TribunalHelper.scorers.AFK = function (game) {

};

TribunalHelper.scorers.AFK.prototype = {

	score: function () {
		if (TribunalHelper.Game.findOutcome) === "Leave") {
			return 100;
		} else {
			return 0;
		}
	}
};

TribunalHelper.App = (function () {
	return {
		//...
		
		run: function () {
			//...
			
			var games = findGames(),
				score = 0,
				game, i, length;
			
			for (i = 0, length = games.length; i < length; i = i + 1) {
				game = new TribunalHelper.GameParser(games[i]);
				
				score = score + game.score();
			}
			
			//average score
			var average = score / games.length;
			if (average > 8) {
				//punish
				suggestion = "Punish";
			} else {
				//Hand
				suggestion = "Hand";
			}
	
			var summary = document.getElementsByClassName("total-reports")[0].innerHTML;
			document.getElementsByClassName("total-reports")[0].innerHTML = summary + "<br /><h2>Tribunal Helper Rating: " + scoreSummary + " / 100  <br /> Suggestion: " + TribunalHelperSuggestion(suggestion) +"</h2>";
		}
	};
}());

console.log("THelper Loaded");
document.getElementsByClassName("reviewing-title")[0].innerHTML = "Tribunal Helper Reviewing Case:";

window.addEventListener('load', function () {
	setTimeout(function() {
		TribunalHelper.App.run();
	}, 5000);
}, false);

/*function getItem (x, y) {
	if (itemCache[x] && itemCache[x][y]) {
		return itemCache[x][y];
	}

	return false;
}
var itemCache = {"0":{"0":"1001","-48":"1033","-96":"1054","-144":"2009","-192":"2048","-240":"3007","-288":"3027","-336":"3044","-384":"3068","-432":"3082","-480":"3093","-528":"3110","-576":"3134","-624":"3146","-672":"3165","-720":"3175","-768":"3196","-816":"3251","-864":"3261","-912":"3271","-960":"3281"},"-48":{"0":"1004","-48":"1036","-96":"1055","-144":"2037","-192":"2049","-240":"3008","-288":"3028","-336":"3046","-384":"3069","-432":"3083","-480":"3096","-528":"3111","-576":"3135","-624":"3151","-672":"3166","-720":"3180","-768":"3197","-816":"3252","-864":"3262","-912":"3272","-960":"3282"},"-96":{"0":"1006","-48":"1037","-96":"1056","-144":"2039","-192":"2050","-240":"3009","-288":"3029","-336":"3047","-384":"3070","-432":"3084","-480":"3097","-528":"3112","-576":"3136","-624":"3152","-672":"3167","-720":"3181","-768":"3198","-816":"3253","-864":"3263","-912":"3273","-960":"3283"},"-144":{"0":"1011","-48":"1038","-96":"1057","-144":"2040","-192":"2051","-240":"3010","-288":"3031","-336":"3048","-384":"3071","-432":"3085","-480":"3098","-528":"3115","-576":"3139","-624":"3153","-672":"3168","-720":"3184","-768":"3200","-816":"3254","-864":"3264","-912":"3274","-960":"3284"},"-192":{"0":"1018","-48":"1039","-96":"1058","-144":"2041","-192":"2052","-240":"3020","-288":"3035","-336":"3050","-384":"3072","-432":"3086","-480":"3100","-528":"3116","-576":"3140","-624":"3154","-672":"3169","-720":"3185","-768":"3206","-816":"3255","-864":"3265","-912":"3275"},"-240":{"0":"1026","-48":"1042","-96":"1062","-144":"2042","-192":"3001","-240":"3022","-288":"3037","-336":"3056","-384":"3073","-432":"3087","-480":"3101","-528":"3117","-576":"3141","-624":"3155","-672":"3170","-720":"3186","-768":"3207","-816":"3256","-864":"3266","-912":"3276"},"-288":{"0":"1027","-48":"1043","-96":"1063","-144":"2043","-192":"3003","-240":"3023","-288":"3040","-336":"3057","-384":"3074","-432":"3089","-480":"3102","-528":"3123","-576":"3142","-624":"3156","-672":"3171","-720":"3187","-768":"3209","-816":"3257","-864":"3267","-912":"3277"},"-336":{"0":"1028","-48":"1051","-96":"1080","-144":"2044","-192":"3004","-240":"3024","-288":"3041","-336":"3060","-384":"3075","-432":"3090","-480":"3105","-528":"3124","-576":"3143","-624":"3157","-672":"3172","-720":"3188","-768":"3211","-816":"3258","-864":"3268","-912":"3278"},"-384":{"0":"1029","-48":"1052","-96":"2003","-144":"2045","-192":"3005","-240":"3025","-288":"3042","-336":"3065","-384":"3077","-432":"3091","-480":"3106","-528":"3128","-576":"3144","-624":"3158","-672":"3173","-720":"3190","-768":"3222","-816":"3259","-864":"3269","-912":"3279"},"-432":{"0":"1031","-48":"1053","-96":"2004","-144":"2047","-192":"3006","-240":"3026","-288":"3043","-336":"3067","-384":"3078","-432":"3092","-480":"3108","-528":"3131","-576":"3145","-624":"3159","-672":"3174","-720":"3191","-768":"3250","-816":"3260","-864":"3270","-912":"3280"}};

var $items = $('#game1 .reported-player .player-items .dd-icon');

$items.each(function () {
   var $item = $(this),
    position = $item.css('background-position');
    var coords = position.split(" ");
    coords[0] = coords[0].replace("px",""); 
    coords[1] = coords[1].replace("px",""); 
    console.log("x: "+coords[0]+" y: "+coords[1]);
    console.log(getItem(coords[0], coords[1]));
});

TLoverlay - Tribunal Loading Overlay, if shown, not loaded. display: show;


*/